import React from 'react';
import {useSearchParams} from "react-router-dom";
import {useQueryString} from "../hooks";

function Cart(props) {
    //方案一：通过自定义hooks函数实现对search参数的处理
    // const {a,b} = useQueryString()
    //方案二：通过useSearchParams钩子实现对search参数的处理
    const [search] = useSearchParams()
    const a = search.get('a')
    const b = search.get('b')
    return (
        <div>
            购物车页面
            a:{a}
            b:{b}
        </div>
    );
}

export default Cart;